package org.example.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.SelectKey;
import org.example.dish_pojo.Order;


/**
* @author Lenovo
* @description 针对表【order(订单主表)】的数据库操作Mapper
* @createDate 2025-08-14 11:03:07
* @Entity com.zhentao.pojo.Order
*/
public interface OrderMapper extends BaseMapper<Order> {
    @Insert("INSERT INTO `order` (order_no, user_id, table_id, order_type, status, create_time, total_amount, pay_method, notes) VALUES (#{orderNo}, #{userId}, #{tableId}, #{orderType}, #{status}, #{createTime}, #{totalAmount}, #{payMethod}, #{notes})")
    @SelectKey(statement = "SELECT LAST_INSERT_ID()", keyProperty = "orderId", before = false, resultType = Integer.class)
    int insert(Order order);


}




